package dao;

import pojo.DoctorWork;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DoctorWorkDao {
    // 基本CRUD方法
    int addDoctorWork(DoctorWork doctorWork);

    int deleteDoctorWork(@Param("day") String day, @Param("docId") String docId);

    int updateDoctorWork(DoctorWork doctorWork);

    DoctorWork getDoctorWorkByDayAndDocId(@Param("day") String day, @Param("docId") String docId);

    List<DoctorWork> getDoctorWorksByDocId(@Param("docId") String docId);

    List<DoctorWork> getDoctorWorksByDay(@Param("day") String day);

    List<DoctorWork> getAllDoctorWorks();

    // 订单数量相关方法
    DoctorWork getDoctorWorkCount(@Param("day") String day, @Param("docId") String docId);

    int updateCountLeft(@Param("day") String day, @Param("docId") String docId, @Param("countLeft") Integer countLeft);

    int updateOrderedCount(@Param("day") String day, @Param("docId") String docId, @Param("orderedCount") Integer orderedCount);

    // 新增：根据父科室ID查询医生排班（对应XML中的selectDoctorWorkByParentDeptId）
    List<DoctorWork> selectDoctorWorkByDeptId(@Param("deptId") Integer parentId);
}